package ClassWork.Work_01;

public class WhileDemo {
    public static void main(String[] args) {
        int num = 999;
        while(true){
            int x = num/100;
            int y = (num%100)/10;
            int z = num%10;
            int m = (int)(Math.pow(x,3)+Math.pow(y,3)+Math.pow(z,3));
            if(m==num){
                System.out.println("最大的水仙花数为：" + m);
                break;
            }
            num--;
        }
    }
}
